const jsonServer = require('json-server')
const path = require('path')
const router =require('./router')
router(server)
const server=jsonServer.create()

server.listen(3000,
    () => {
        console.log("服务器已经启动！")
    })

const middlewares = jsonServer.defaults({
    static: path.join(__dirname, 'public'),
})

/*中间件*/
server.use(jsonServer.defaults())
server.use(jsonServer.bodyParser)